function myInstanceof (child: any, parent:any) {
  let c = Object.getPrototypeOf(child);
  let p = parent.prototype;
  while (true) {
    if (c === null || p === null) {
      return false
    }
    if (c === p) {
      return true
    }
    c = Object.getPrototypeOf(c);;
  }
}


function A () {

}


var a = new A();



console.log(myInstanceof(a, A), 1000);
